<?php

//Author: Aya El Mobayad
//specifies the connection to the server, as well as the username and password and opens it.
$conn = @mysql_connect('localhost', 'root', '') or die(mysql_error());
//The database being used is selected from the open connection
mysql_select_db("mydb") or die(mysql_error());
//If the announcement ID was passed from the previous page.
if (isset($_GET['ann_id'])) {
    //The announcementID is stored in a variable
    $announcement = $_GET['ann_id'];
    //The announcement ID is passed to a query which deletes the news record in the
    //table with that ID
    mysql_query("DELETE FROM o_postnews_conference WHERE ann_id = '$announcement'");
}
//The connection to the database is closed.
mysql_close($conn);

//a header is created to redirect back to the viewNews page
header("Location: viewNews.php");

//End Documentation
?>
